package com.example.demo.dao;

import com.example.demo.domain.Supplier;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ${author}
 * @since 2022-10-30
 */
@Mapper

public interface SupplierDao extends BaseMapper<Supplier> {

    @Select("select * from supplier s" +
            " inner join commodity_suppliers cs on s.id=cs.suppliers_id" +
            " where cs.commodity_id = #{commodityIds}")
    public List<Supplier> findSuppliersByCommodity(String commodityId);

}
